package com.cf.studiomanage.service.impl;

import com.cf.studiomanage.entity.Announcement;
import com.cf.studiomanage.mapper.AnnouncementMapper;
import com.cf.studiomanage.service.AnnouncementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AnnouncementServiceImpl implements AnnouncementService {

    @Autowired
    private AnnouncementMapper mapper;

    @Override
    public boolean publish(Announcement announcement) {
        return mapper.publish(announcement) > 0;
    }

    @Override
    public List<Announcement> getAll() {
        return mapper.getAll();
    }

    @Override
    public Announcement getById(Long id) {
        return mapper.getById(id);
    }
}
